package com.lanmaoly.web.common.response;

import lombok.ToString;

/**
 * 枚举类
 *
 * @author Administrator
 */

@ToString
public enum CommonCode implements ResultCode {

    /**
     * 成功
     */
    SUCCESS(true, 200, "操作成功"),
    USER_EXIST(true, 20001, "用户已缓存"),
    USER_NOT_EXIST(true, 20002, "用户未缓存"),
    FAIL(false, 500, "操作失败"),
    VERIFY_PARAM_MISS(false, 10001, "编号和文件二选一"),
    VERIFY_CODE_EXPIRED(false, 10002, "验证码已失效"),
    VERIFY_CODE_ERROR(false, 10003, "验证码错误"),
    STORAGE_RECORD_MISS(false, 10004, "未查询到存证记录，请核实后进行验证"),
    IDENTITY_VERIFY_ERROR(false, 10005, "身份核验未通过，请核实后重新输入"),
    IDENTITY_NO_LENDER(false, 10006, "当前查询身份不是出借人，懒猫暂无法出具存证证书"),
    DATA_TYPE_NO_ISSUE_REPORT(false, 10007, "该数据暂不支持出具存证证书"),
    ABNORMAL_DATA_ERROR(false, 10008, "数据异常请联系技术支持人员"),
    HTTP_REQUEST_ERROR(false, 10009, "请求超时");

    boolean success;
    int code;
    String message;

    CommonCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return success;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }

}
